Skip to content

bpo-37169: Rewrite _PyObject_IsFreed() unit tests#13888

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:test_is_freed
Jun 7, 2019
Merged

bpo-37169: Rewrite _PyObject_IsFreed() unit tests#13888
vstinner merged 1 commit into
python:masterfrom
vstinner:test_is_freed

Conversation

@vstinner

@vstinner vstinner commented Jun 7, 2019

Copy link
Copy Markdown
Member

Replace two Python function calls with a single one to ensure that no
memory allocation is done between the invalid object is created and
when _PyObject_IsFreed() is called.

https://bugs.python.org/issue37169

Replace two Python function calls with a single one to ensure that no
memory allocation is done between the invalid object is created and
when _PyObject_IsFreed() is called.

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Why we have never seen this test fail?

@vstinner

vstinner commented Jun 7, 2019

Copy link
Copy Markdown
Member Author

Why we have never seen this test fail?

No idea why https://bugs.python.org/issue37169 only fails on the openSUSE builder. It might depend on compiler optimizations like PGO or LTO?

@vstinner vstinner merged commit 3bf0f3a into python:master Jun 7, 2019
@vstinner vstinner deleted the test_is_freed branch June 7, 2019 14:22
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @vstinner, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 3bf0f3ad2046ac674d8e8a2c074a5a8b3327797d 3.8

@bedevere-bot

Copy link
Copy Markdown

GH-13895 is a backport of this pull request to the 3.8 branch.

vstinner added a commit that referenced this pull request Jun 7, 2019
Replace two Python function calls with a single one to ensure that no
memory allocation is done between the invalid object is created and
when _PyObject_IsFreed() is called.

(cherry picked from commit 3bf0f3a)
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Replace two Python function calls with a single one to ensure that no
memory allocation is done between the invalid object is created and
when _PyObject_IsFreed() is called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants